package com.alan.designMode.command;

/**
 * Created by Alan on 17-9-18
 */
public class ConcreteCommand2 extends Command{
    //对哪个Recevier类进行命令处理
    //private Receiver receiver;

    //声明自己默认的接收者
    public ConcreteCommand2() {
        super(new ConcreteReciver1());
    }

    //设置新的接收者
    public ConcreteCommand2(Receiver receiver) {
        super(receiver);
    }

    //必须实现一个命令
    @Override
    public void execute() {
        this.receiver.doSomething();
    }
}
